import { Router } from 'express'
import { find } from '../../db/dao'
import { MONEY } from '../../db/model'

const router = Router()

router.get('/list', function (req, res) {
  const promise = find(MONEY)
  promise.then(money => {
    res.json(money)
  }).catch(() => {
    res.status(500).json()
  })
})

export default router
